package com.googlecode.connectlet.crypto.keystore;

import com.googlecode.connectlet.crypto.stream.RC4Cipher;
import com.googlecode.connectlet.util.Bytes;

public class RC4PBKDF {
	public static byte[] genKey(int len, String password, byte[] salt, int iterationCount) {
		RC4Cipher cipher = new RC4Cipher(Bytes.add(password.getBytes(), salt));
		for (int i = 0; i < iterationCount; i ++) {
			cipher.output();
		}
		return cipher.output(len);
	}
}